<%
    var headContent = {
%>
<style>
  .table-content>thead>tr>th,.table-content>tbody>tr>td{
    width:3%;
  }
</style>
<%
};
%>
<%layout("/common/_layout.html",{head:headContent}){ %>
<%#ajax userTable:{%>
<div class="am-cf am-padding am-margin-0" style="padding:1rem 1.6rem 1.6rem 1rem;">
  <!--  padding:1px 2px 3px 4px;上、右、下,和左   -->
  <div class="am-fl am-cf"> <strong class="am-text-primary am-text-lg">报表中心</strong>
    /
    <small>宽带预约报表</small>
  </div>
</div>
<div class="am-g"></div>
<div class="am-g">
  <%include("broadband_report_query.tpl"){}%>
</div>
<div class="am-g" >
  <div class="am-u-sm-12 am-scrollable-horizontal">
    <!--  padding:1px 2px 3px 4px;上、右、下,和左   -->
    <table class="am-table am-table-bordered am-table-striped am-table-compact am-table-hover table-main am-padding-0 table-content">
      <thead>
        <tr class="">
          <th class="table-title">称呼</th>
          <!-- <th class="table-title">服务类型</th> -->
          <th class="table-title">客户号码</th>
          <th class="table-title">所在城市</th>
          <th class="table-title">所在区县</th>
          <th class="table-title">宽带名称</th>

          <th class="table-title">其他联系电话</th>
          <th class="table-title">安装小区</th>
          <th class="table-title">成员手机号1</th>
          <th class="table-title">成员手机号2</th>
          <th class="table-title">成员手机号3</th>
          <th class="table-title">期望安装时间</th>
          <!--预约外呼时间 = 提交宽带预约时间 + 2天-->
          <th class="table-title">预约外呼时间</th>
          <th class="table-title">反馈内容</th>
          <th class="table-title">资费代码</th>

          <th class="table-title">渠道编码</th>
          <th class="table-title">渠道类型</th>
          <th class="table-title">预约地址</th>
          <th class="table-title">预约状态</th>
          <th class="table-date">预约日期</th>
          <th class="table-date">预约时间</th>
          <th class="table-date">结单时间</th>
          <th class="table-title">店员工号</th>
          <th calss="table-title">店员身份</th>
          <th class="table-title">客户经理</th>
          <th class="table-title">办理来源</th>
        </tr>
      </thead>
      <tbody>
        <%for(list in pager.list!){
          var member_phone = list.member_phone;
          var phone1 = "";
          var phone2 = "";
          var phone3 = "";
          var i = 0;
          if(member_phone != null){
            var phoneArr = strutil.split(member_phone,",");
            for(phone in phoneArr){
              i++;
            }
            
            if(i == 1){
            
              if( phoneArr[0] != null){
              
                  if(strutil.length(phoneArr[0])==11){
                     phone1 = strutil.subStringTo(phoneArr[0],0,3)+"****"+strutil.subStringTo(phoneArr[0],7,11);
                  }else{
                      if(!isEmpty(phoneArr[0])){
                         phone1 = "******";
                      }

                  }
              }
            
            }else if(i == 2){
              
              if( phoneArr[0] != null){
                  if(strutil.length(phoneArr[0])==11){
                     phone1 = strutil.subStringTo(phoneArr[0],0,3)+"****"+strutil.subStringTo(phoneArr[0],7,11);
                  }else{
                      if(!isEmpty(phoneArr[0])){
                         phone1 = "******";
                      }
                  }
              }
              
              if( phoneArr[1] != null){
                  if(strutil.length(phoneArr[1])==11){
                     phone2 = strutil.subStringTo(phoneArr[1],0,3)+"****"+strutil.subStringTo(phoneArr[1],7,11);
                  }else{
                       if(!isEmpty(phoneArr[1])){
                         phone2 = "******";
                       }
                  }
              }
              
              
            }else if(i == 3){
              
              if( phoneArr[0] != null){
                  if(strutil.length(phoneArr[0])==11){
                     phone1 = strutil.subStringTo(phoneArr[0],0,3)+"****"+strutil.subStringTo(phoneArr[0],7,11);
                  }else{
                      if(!isEmpty(phoneArr[0])){
                         phone1 = "******";
                      }
                  }
              }
              
              if( phoneArr[1] != null){
                  if(strutil.length(phoneArr[1])==11){
                     phone2 = strutil.subStringTo(phoneArr[1],0,3)+"****"+strutil.subStringTo(phoneArr[1],7,11);
                  }else{
                       if(!isEmpty(phoneArr[1])){
                         phone2 = "******";
                       }
                  }
              }
              
              if( phoneArr[2] != null){
                  if(strutil.length(phoneArr[2])==11){
                     phone3 = strutil.subStringTo(phoneArr[2],0,3)+"****"+strutil.subStringTo(phoneArr[2],7,11);
                  }else{
                       if(!isEmpty(phoneArr[2])){
                         phone3 = "******";
                       }
                    
                  }
              }
              
              
            }
          }
          
          var telephone = "";
           if(list.telephone != null){
             if(strutil.length(list.telephone)==11){
                 telephone = strutil.subStringTo(list.telephone,0,3)+"****"+strutil.subStringTo(list.telephone,7,11);
             }else{
                 telephone = "******";
             }
           }
           
         var other_contact_phone = "";
          if(list.other_contact_phone != null){
             if(strutil.length(list.other_contact_phone)==11){
                 other_contact_phone = strutil.subStringTo(list.other_contact_phone,0,3)+"****"+strutil.subStringTo(list.other_contact_phone,7,11);
             }else{
                 other_contact_phone = "******";
             }
           }

        %>
        
        <tr>
          <td>${list.gender}</td>
          <!-- <td>${list.service_type}</td> -->
          <td>${telephone}</td>
          <td>${list.city}</td>
          <td>${list.area}</td>
          <td>${list.name}</td>

          <td>${other_contact_phone}</td>
          <td>******</td>
          <td>${phone1}</td>
          <td>${phone2}</td>
          <td>${phone3}</td>
          <td>${list.expected_install_time}</td>
          <td>${list.call_time}</td>
          <td>${list.feed_back}</td>
          <td>******</td>

          <td>${list.num_code}</td>
          <td>${list.org_type}</td>
          <td>******</td>
          <td>${list.reservation_state}</td>
          <td>${list.create_date, dateFormat="yyyy-MM-dd"}</td>
          <td>${list.create_date, dateFormat="HH:mm:ss"}</td>
          <td>${list.end_date, dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
          <td>${list.emp_code}</td>
          <td>${list.memberType}</td>
          <td>${list.is_accounts_manager}</td>
          <td>${list.saletype}</td>
        </tr>
        <%}%>
      </tbody>
    </table>

    <div class="am-cf">
      <!-- 分页 -->
      <%if (pager.list.~size >
      0){%>
      <div class="am-fr">
        <% include("/admin/common_pager.tpl"){}%></div>
      <%}else{%>
      <div class="am-kai">
        <h3>没有找到任何记录!</h3>
      </div>
      <%}%>
    </div>
    <%}%>
  </div>
</div>
<%}%>